/*
	AppPlugin.h
	All definitions for GPUrrs Elvis! plugins
	2006 John Wiggins
	Based on code from Jeepers Elvis, 2000 John Wiggins
*/
//-------------------------------------------------------------
#ifndef APP_PLUGIN_H
#define APP_PLUGIN_H
//-------------------------------------------------------------
#include "Basics/BasTypes.h"
#include "Render/RenSurface.h"
//-------------------------------------------------------------
/*
	Example:
	
void * instantiate_example_source( void *arg );
void * instantiate_example_mixer( void *arg );
void * instantiate_example_filter( void *arg );

extern "C" _EXPORT ge_plugin **get_plugins();

ge_plugin source_plugin =
	{GE_SOURCE_PLUGIN, "Example Source Plugin", instantiate_example_source};
ge_plugin mixer_plugin =
	{GE_MIXER_PLUGIN, "Example Mixer Plugin", instantiate_example_mixer};
ge_plugin filter_plugin =
	{GE_FILTER_PLUGIN, "Example Filter Plugin", instantiate_example_filter};

static ge_plugin *plugins[] = {
	&source_plugin,
	&mixer_plugin,
	&filter_plugin,
	NULL
};

// exported function
ge_plugin **get_plugins()
{
	return plugins;
}
*/
//-------------------------------------------------------------
enum ge_plugin_type
{
	GE_SOURCE_PLUGIN = 1,
	GE_MIXER_PLUGIN,
	GE_FILTER_PLUGIN,
	GE_OUTPUT_PLUGIN
};
//-------------------------------------------------------------
// generic struct for all plugins
struct ge_plugin
{
	ge_plugin_type type;
	char const *short_desc; // truncated to 255 characters
 	void *( *instantiate )( void * ); // void * instantiate( void *arg );
};
//-------------------------------------------------------------
// a source plugin
struct ge_source_plugin
{
	void ( *initSurface )( ge_source_plugin *cookie, RenSurface *frame );
	void ( *getFrame )( ge_source_plugin *cookie, RenSurface *frame );
	void ( *destroy )( ge_source_plugin *cookie );
	
	void *data;
};
//-------------------------------------------------------------
// a mixer plugin
struct ge_mixer_plugin
{
	void ( *mix )( ge_mixer_plugin *cookie, uint32 numSrcs, RenSurface **srcList,
							RenSurface *dst );
	void ( *destroy )( ge_mixer_plugin *cookie );
	
	uint32 max_inputs;
	void *data;
};
//-------------------------------------------------------------
// a filter plugin
struct ge_filter_plugin
{
	void ( *filter )( ge_filter_plugin *cookie, RenSurface *source, RenSurface *dest );
	void ( *destroy )( ge_filter_plugin *cookie );
	
	void *data;
};
//-------------------------------------------------------------
// an output plugin
struct ge_output_plugin
{
	void ( *output )( ge_output_plugin *cookie, RenSurface *frame );
	void ( *destroy )( ge_output_plugin *cookie );
	
	void *data;
};
//-------------------------------------------------------------
#endif // APP_PLUGIN_H

